1700 |
How do I layout expandable columns
G2antt1->BeginUpdate(); G2antt1->ColumnAutoResize = false; G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; G2antt1->BackColorLevelHeader = G2antt1->BackColor; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"C0"); var_Column->ExpandColumns = L"1,2"; var_Column->DisplayExpandButton = true; var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); var_Columns->Add(L"C3"); Exg2anttlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"C4"); var_Column1->ExpandColumns = L"5,6"; var_Column1->DisplayExpandButton = true; var_Columns->Add(L"C5"); Exg2anttlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"C6"); var_Column2->ExpandColumns = L"6,7"; var_Column2->DisplayExpandButton = true; var_Columns->Add(L"C7"); G2antt1->EndUpdate(); G2antt1->Columns->get_Item(TVariant("C4"))->Expanded = false; |
1699 |
Is it possible to display automatically the start/end margins of the bars
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<%=%1%>")); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(16)); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarExtraCaption,TVariant("<%=%2%>")); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarExtraCaptionHAlign,TVariant(18)); var_Chart->ScrollTo(var_Chart->get_FirstVisibleDate(),TVariant(1)); G2antt1->Columns->Add(L"Task"); G2antt1->Columns->Add(L"ToolTip")->Visible = false; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Item 1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("bar <b>a")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2000,12,29).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("Item 2")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("bar <b>b")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2000,12,30).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1698 |
Is it possible to assign the bar's caption from a hidden column
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<%=%C1%>")); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(18)); G2antt1->Columns->Add(L"Task"); G2antt1->Columns->Add(L"ToolTip")->Visible = false; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Item 1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("bar <b>a")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("Item 2")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("bar <b>b")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1697 |
Is it possible to assign the bar's tooltip from a hidden column
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); var_Chart->Bars->get_Item(TVariant("Task"))->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarToolTip,TVariant("<%=%C1%>")); G2antt1->Columns->Add(L"Task"); G2antt1->Columns->Add(L"ToolTip")->Visible = false; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Item 1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("This is a bit of text that's shown when the cursor hovers the bar on item 1.")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("Item 2")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("This is a bit of text that's shown when the cursor hovers the bar on item 2.")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1696 |
I am using exBarFrameColor, but no black frame is shown. What could be wrong (method 2)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Default")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(65536)); G2antt1->EndUpdate(); |
1695 |
I am using exBarFrameColor, but no black frame is shown. What could be wrong (method 1)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); var_Chart->Bars->get_Item(TVariant("Task"))->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(65536)); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Default")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1694 |
What I need is bars that have a solid color, but with a black frame. How can we do that
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 22; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,0); Exg2anttlib_tlb::IBarPtr var_Bar = G2antt1->Chart->Bars->Add(L"Frame"); var_Bar->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar->Color = RGB(0,255,0); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(65536)); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<font ;6><%=%C0%>")); var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(18)); var_Bar->Height = 15; G2antt1->Columns->Add(L"Frames"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Default")),TVariant("Frame"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); long h = var_Items->AddItem(TVariant("Inside Color")); var_Items->AddBar(h,TVariant("Frame"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(255)); h = var_Items->AddItem(TVariant("Border Color")); var_Items->AddBar(h,TVariant("Frame"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(33023)); h = var_Items->AddItem(TVariant("Inside/Border Color")); var_Items->AddBar(h,TVariant("Frame"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(16711680)); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(33023)); h = var_Items->AddItem(TVariant("Thick-Border")); var_Items->AddBar(h,TVariant("Frame"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarPattern,TVariant(4097)); h = var_Items->AddItem(TVariant("Thick-Border + Pattern")); var_Items->AddBar(h,TVariant("Frame"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarPattern,TVariant(4098)); G2antt1->EndUpdate(); |
1693 |
How can we drag bars from one item to the other
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 22; G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; G2antt1->Columns->Add(L"Members")->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2006,9,20).operator double())); var_Chart->AllowLinkBars = false; var_Chart->AllowCreateBar = Exg2anttlib_tlb::CreateBarEnum::exNoCreateBar; var_Chart->AllowSelectObjects = Exg2anttlib_tlb::SelectObjectsEnum::exNoSelectObjects; var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,96); var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->OverlaidType = Exg2anttlib_tlb::OverlaidBarsTypeEnum::exOverlaidBarsIncludeCaption | Exg2anttlib_tlb::OverlaidBarsTypeEnum::exOverlaidBarsStackAutoArrange | Exg2anttlib_tlb::OverlaidBarsTypeEnum::exOverlaidBarsStack; var_Bar->Height = 18; var_Bar->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar->Color = RGB(0,128,255); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Member <b>1</b>")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2006,9,21).operator double()),TVariant(TDateTime(2006,9,23).operator double()),TVariant("T102"),TVariant("<font ;6><fgcolor FFFFFF>Task <b>102</b>")); var_Items->set_ItemBar(h,TVariant("T102"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCanMoveToAnother,TVariant(true)); h = var_Items->AddItem(TVariant("Member <b>2</b>")); h = var_Items->AddItem(TVariant("Member <b>3</b>")); h = var_Items->AddItem(TVariant("Member <b>4</b>")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2006,9,21).operator double()),TVariant(TDateTime(2006,9,23).operator double()),TVariant("T103"),TVariant("<font ;6><fgcolor FFFFFF>Task <b>103</b>")); var_Items->set_ItemBar(h,TVariant("T103"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCanMoveToAnother,TVariant(true)); G2antt1->EndUpdate(); |
1692 |
How can I use the exBarBackgroundExt option of the Items.ItemBar property
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 26; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->NonworkingDays = 0; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); var_Chart->Bars->get_Item(TVariant("Task"))->Height = 22; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Border-Top")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("top[3,back=RGB(0,0,0)]")); h = var_Items->AddItem(TVariant("Border-Bottom")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("bottom[3,back=RGB(255,0,0)]")); h = var_Items->AddItem(TVariant("Border-Left")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[6,back=RGB(0,255,0)]")); h = var_Items->AddItem(TVariant("Border-Right")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("right[6,back=RGB(0,0,255)]")); h = var_Items->AddItem(TVariant("Border-All")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("top[3,back=RGB(0,0,0)],right[3,back=RGB(0,0,255)],bottom[3,back=RGB(255,0,0)],left[3,back=RGB(0,255,0)],client")); h = var_Items->AddItem(TVariant("Middle")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("none[(25%,25%,50%,50%),back=RGB(255,0,0)]")); h = var_Items->AddItem(TVariant("Horizontal")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("none[(0,50%-2,100%,4),back=RGB(255,0,0)]")); h = var_Items->AddItem(TVariant("Vertical")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("none[(50%-2,0,4,100%),back=RGB(255,0,0)]")); h = var_Items->AddItem(TVariant("Mixt")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]")); h = var_Items->AddItem(TVariant("Misc")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("bottom[50%,pattern=10,frame]")); h = var_Items->AddItem(TVariant("Complex")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[10%](top[90%,back=RGB(0,0,0)]),top[30%,back=RGB(254,217,102)],client[back=RGB(91,156,212)]")); G2antt1->EndUpdate(); |
1691 |
Does the title of the cell's tooltip supports HTML format
G2antt1->BeginUpdate(); G2antt1->Chart->set_PaneWidth(true,0); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L""); var_Column->Caption = L""; var_Column->HTMLCaption = L"Column"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellToolTip(TVariant(var_Items->AddItem(TVariant("tooltip w/h different title"))),TVariant(0),TVariant(String("<c><b><fgcolor=FF0000>Title</fgcolor></b><br>This is bit of text that's shown when the user hovers the cell. This shows the tit") + "le centered with a different color.")); G2antt1->EndUpdate(); |
1690 |
How do I specify a different title for the cell's tooltip
G2antt1->BeginUpdate(); G2antt1->Chart->set_PaneWidth(true,0); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L""); var_Column->Caption = L"This is the title"; var_Column->HTMLCaption = L"Column"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellToolTip(TVariant(var_Items->AddItem(TVariant("tooltip w/h different title"))),TVariant(0),L"This is bit of text that's shown when the user hovers the cell."); G2antt1->EndUpdate(); |
1689 |
The cell's tooltip displays the column's caption in its title. How can I get ride of that
G2antt1->BeginUpdate(); G2antt1->Chart->set_PaneWidth(true,0); Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("tooltip w/h caption")); var_Items->set_CellToolTip(TVariant(h),TVariant(0),L"This is bit of text that's shown when the user hovers the cell. This shows the column's caption in the title."); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("tooltip no caption")); var_Items->set_CellToolTip(TVariant(h),TVariant(1),L"This is bit of text that's shown when the user hovers the cell. This shows no column's caption in the title."); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->get_Item(TVariant("C2")); var_Column->HTMLCaption = var_Column->Caption; var_Column->Caption = L""; G2antt1->EndUpdate(); |
1688 |
How can I programmatically show the column's filter
// RClick event - Fired when right mouse button is clicked void __fastcall TForm1::G2antt1RClick(TObject *Sender) { // Columns(c).ShowFilter("-1,-1,128,128") long i = G2antt1->ItemFromPoint[-1,-1,c,hit]; } G2antt1->BeginUpdate(); G2antt1->ShowFocusRect = false; Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Items "); var_Column->DisplayFilterPattern = false; var_Column->FilterList = Exg2anttlib_tlb::FilterListEnum::exShowExclude | Exg2anttlib_tlb::FilterListEnum::exShowFocusItem | Exg2anttlib_tlb::FilterListEnum::exShowCheckBox; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); var_Items->AddItem(TVariant("Item 3")); G2antt1->EndUpdate(); |
1687 |
I want to be able to click on one of the headers, and sort by other column. How can I do that (method 2)
// ColumnClick event - Fired after the user clicks on column's header. void __fastcall TForm1::G2antt1ColumnClick(TObject *Sender,Exg2anttlib_tlb::IColumn *Column) { // Column.SortOrder = 1 G2antt1->SortOnClick = Exg2anttlib_tlb::SortOnClickEnum::exDefaultSort; G2antt1->Columns->get_Item(TVariant("Sort"))->SortOrder = Exg2anttlib_tlb::SortOrderEnum::SortAscending; G2antt1->SortOnClick = Exg2anttlib_tlb::SortOnClickEnum::exUserSort; } G2antt1->BeginUpdate(); G2antt1->SortOnClick = Exg2anttlib_tlb::SortOnClickEnum::exUserSort; G2antt1->Columns->Add(L"Items"); G2antt1->Columns->Add(L"Sort")->Visible = false; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Item 1 (3)"))),TVariant(1),TVariant(3)); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Item 2 (1)"))),TVariant(1),TVariant(1)); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Item 3 (2)"))),TVariant(1),TVariant(2)); G2antt1->EndUpdate(); |
1686 |
I want to be able to click on one of the headers, and sort by other column. How can I do that (method 1)
// ColumnClick event - Fired after the user clicks on column's header. void __fastcall TForm1::G2antt1ColumnClick(TObject *Sender,Exg2anttlib_tlb::IColumn *Column) { // Column.SortOrder = 1 G2antt1->Items->SortChildren(0,TVariant("Sort"),true); } G2antt1->BeginUpdate(); G2antt1->SortOnClick = Exg2anttlib_tlb::SortOnClickEnum::exUserSort; G2antt1->Columns->Add(L"Items"); G2antt1->Columns->Add(L"Sort")->Visible = false; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Item 1 (3)"))),TVariant(1),TVariant(3)); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Item 2 (1)"))),TVariant(1),TVariant(1)); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Item 3 (2)"))),TVariant(1),TVariant(2)); G2antt1->EndUpdate(); |
1685 |
How do I get information about control's events
// Event event - Notifies the application once the control fires an event. void __fastcall TForm1::G2antt1Event(TObject *Sender,long EventID) { OutputDebugString( PChar(G2antt1->ExecuteTemplate(L"EventParam(-2)")) ); } G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,48); var_Chart->AllowLinkBars = false; var_Chart->Bars->get_Item(TVariant("Task"))->OverlaidType = Exg2anttlib_tlb::OverlaidBarsTypeEnum::exOverlaidBarsTransparent | Exg2anttlib_tlb::OverlaidBarsTypeEnum::exOverlaidBarsOffset; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Item 1")); var_Items->set_EnableItem(h,false); var_Items->set_ItemData(h,TVariant(-1)); h = var_Items->AddItem(TVariant("Item 2")); var_Items->set_ItemData(h,TVariant(0)); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,5).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TVariant("B"),TNoParam()); var_Items->set_ItemBar(h,TVariant("B"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCanMoveToAnother,TVariant(true)); var_Items->set_ItemData(var_Items->AddItem(TVariant("Item 3")),TVariant(0)); h = var_Items->AddItem(TVariant("Item 4")); var_Items->set_EnableItem(h,false); var_Items->set_ItemData(h,TVariant(-1)); G2antt1->EndUpdate(); |
1684 |
How can I sort by two-columns, one by date and one by time
G2antt1->BeginUpdate(); G2antt1->SingleSort = false; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Index")->FormatColumn = L"1 index ``"; var_Columns->Add(L"Date")->SortType = Exg2anttlib_tlb::SortTypeEnum::SortDate; Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Time"); var_Column->SortType = Exg2anttlib_tlb::SortTypeEnum::SortTime; var_Column->FormatColumn = L"time(value)"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant(0)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(TDateTime(2001,1,1,10,00,00,0).operator double())); h = var_Items->AddItem(TVariant(0)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2000,12,31).operator double())); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(TDateTime(2001,1,1,10,00,00,0).operator double())); h = var_Items->AddItem(TVariant(0)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(TDateTime(2001,1,1,6,00,00,0).operator double())); h = var_Items->AddItem(TVariant(0)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2000,12,31).operator double())); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(TDateTime(2001,1,1,8,00,00,0).operator double())); h = var_Items->AddItem(TVariant(0)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(TDateTime(2001,1,1,8,00,00,0).operator double())); h = var_Items->AddItem(TVariant(0)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2000,12,31).operator double())); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(TDateTime(2001,1,1,6,00,00,0).operator double())); G2antt1->Layout = L"multiplesort=\"C1:1 C2:1\""; G2antt1->EndUpdate(); |
1683 |
I am trying to hide the non-working dates by using the AddNonworkingDate to specify custom non-working dates while NonworkingDays property is 0, but the non-working date is still shown. What can be wrong
|
1682 |
How can I display the task's duration, in days, hours and minutes
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Tasks"); var_Column->AllowSizing = false; var_Column->Width = 36; Exg2anttlib_tlb::IColumnPtr var_Column1 = G2antt1->Columns->Add(L"Duration"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(513)); var_Column1->FormatColumn = TVariant(String("((1:=int(0:= (value))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ") + "? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,148); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2009,4,6).operator double())); var_Chart->LevelCount = 2; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exHour; var_Chart->ResizeUnitScale = Exg2anttlib_tlb::UnitEnum::exMinute; G2antt1->Items->AllowCellValueToItemBar = true; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("T1")),TVariant("Task"),TVariant(TDateTime(2009,4,6,2,30,00,0).operator double()),TVariant(TDateTime(2009,4,6,12,35,00,0).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("T2")),TVariant("Task"),TVariant(TDateTime(2009,4,6,9,00,00,0).operator double()),TVariant(TDateTime(2009,4,6,10,10,00,0).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1681 |
Does your control support working half-hour/minutes/seconds
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Tasks"); var_Column->AllowSizing = false; var_Column->Width = 36; Exg2anttlib_tlb::IColumnPtr var_Column1 = G2antt1->Columns->Add(L"Working"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(258)); var_Column1->FormatColumn = TVariant(String("((1:=int(0:= (value))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ") + "? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2009,4,6).operator double())); var_Chart->set_PaneWidth(false,148); var_Chart->LevelCount = 2; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exHour; var_Chart->ResizeUnitScale = Exg2anttlib_tlb::UnitEnum::exMinute; var_Chart->ResizeUnitCount = 15; var_Chart->NonworkingHours = 15728767; var_Chart->ShowNonworkingDates = false; var_Chart->ShowNonworkingUnits = false; var_Chart->ShowNonworkingHours = false; Exg2anttlib_tlb::IBarsPtr var_Bars = var_Chart->Bars; var_Bars->Add(L"Task:Split")->Shortcut = L"Task"; var_Bars->get_Item(TVariant("Task"))->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); var_Chart->AllowLinkBars = false; var_Chart->UnitWidth = 26; G2antt1->Items->AllowCellValueToItemBar = true; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("T1")); var_Items->set_ItemNonworkingUnits(h,TVariant(false),L"(weekday(value) in (1,2,3,4,5) and (timeF(value)<\"09:30\" or timeF(value)>=\"17:30\")) or (weekday(value) in (0,6))"); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2009,4,6,10,00,00,0).operator double()),TVariant(TDateTime(2009,4,6,12,30,00,0).operator double()),TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("T2")); var_Items->set_ItemNonworkingUnits(h,TVariant(false),L"(weekday(value) in (1,2,3,4,5) and (timeF(value)<\"08:00\" or timeF(value)>=\"16:00\")) or (weekday(value) in (0,6))"); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2009,4,6,9,30,00,0).operator double()),TVariant(TDateTime(2009,4,6,10,45,00,0).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1680 |
How can I programmatically move a bar to a specified date-time
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Original")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); h = var_Items->AddItem(TVariant("Moved")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); TVariant duration = TVariant(var_Items->get_ItemBar(h,TVariant("key"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarDuration)); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,5).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); var_Items->set_ItemBar(h,TVariant("key"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarDuration,TVariant(duration)); G2antt1->EndUpdate(); |
1679 |
How can I programmatically move a bar, with a specified ammount
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Original")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); h = var_Items->AddItem(TVariant("Moved")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); var_Items->set_ItemBar(h,TVariant("key"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarMove,TVariant(3)); G2antt1->EndUpdate(); |
1678 |
How can I programmatically move a bar to a specified date-time (auto-adjust spans over a non-working period)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); Exg2anttlib_tlb::IBarsPtr var_Bars = var_Chart->Bars; var_Bars->get_Item(TVariant("Task"))->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); var_Bars->Add(L"Task:Split")->Shortcut = L"Task"; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Original")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); h = var_Items->AddItem(TVariant("Moved")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); TVariant workingCount = TVariant(var_Items->get_ItemBar(h,TVariant("key"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarWorkingCount)); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,5).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); var_Items->set_ItemBar(h,TVariant("key"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarWorkingCount,TVariant(workingCount)); G2antt1->EndUpdate(); |
1677 |
How can I programmatically move a bar, with a specified ammount (auto-adjust spans over a non-working period)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,64); Exg2anttlib_tlb::IBarsPtr var_Bars = var_Chart->Bars; var_Bars->get_Item(TVariant("Task"))->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); var_Bars->Add(L"Task:Split")->Shortcut = L"Task"; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Original")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); h = var_Items->AddItem(TVariant("Moved")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("key"),TNoParam()); var_Items->set_ItemBar(h,TVariant("key"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarMove,TVariant(3)); G2antt1->EndUpdate(); |
1676 |
How can I show a secondary curve, line in the control's histogram
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); G2antt1->AntiAliasing = true; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,40); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,9).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramNoGrouping | Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 128; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar->HistogramItems = 8; var_Bar->HistogramRulerLinesColor = RGB(0,0,1); var_Chart->get_Level(1)->set_Label(TVariant("<font ;3><%d%>")); var_Chart->UnitWidth = 9; Exg2anttlib_tlb::IBarPtr var_Bar1 = var_Chart->Bars->get_Item(TVariant("Summary")); var_Bar1->HistogramPattern = Exg2anttlib_tlb::PatternEnum::exRoundCurve; var_Bar1->HistogramColor = RGB(255,0,0); var_Bar1->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar1->HistogramItems = 8; var_Bar1->HistogramBorderSize = 1; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_LockedItemCount(Exg2anttlib_tlb::VAlignmentEnum::exTop,1); long h = var_Items->get_LockedItem(Exg2anttlib_tlb::VAlignmentEnum::exTop,0); var_Items->set_ItemHeight(h,0); var_Items->AddBar(h,TVariant("Summary"),TVariant(TDateTime(2005,1,1).operator double()),TVariant(TDateTime(2005,12,31).operator double()),TVariant("1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("(value mod 31) array (1,1,1,2,1,2.5,3,4,5,4,3,2,1,2,2,3,4.5,4,5,6,7,6,1,2,3,1,1,1,2,3,2,2)")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,7,16).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("weekday(value) in (0,6) ? 0.25 : 2")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,18).operator double()),TVariant(TDateTime(2005,7,21).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("weekday(value) = 1 ? 2.5 : .5")); G2antt1->EndUpdate(); |
1675 |
How can I add an owner-draw bar
// AfterDrawPart event - Occurs right after drawing the part of the control. void __fastcall TForm1::G2antt1AfterDrawPart(TObject *Sender,Exg2anttlib_tlb::DrawPartEnum Part,long hDC,long X,long Y,long Width,long Height) { OutputDebugString( L"AfterDrawPart" ); OutputDebugString( L"Part" ); OutputDebugString( G2antt1->Items->get_CellCaption(TVariant(G2antt1->DrawPartItem),TVariant(0)) ); OutputDebugString( PChar(G2antt1->get_DrawPartKey()) ); } // BeforeDrawPart event - Occurs just before drawing a part of the control. void __fastcall TForm1::G2antt1BeforeDrawPart(TObject *Sender,Exg2anttlib_tlb::DrawPartEnum Part,long hDC,long * X,long * Y,long * Width,long * Height,VARIANT_BOOL * Cancel) { Cancel = true; OutputDebugString( L"BeforeDrawPart" ); OutputDebugString( L"Part" ); OutputDebugString( G2antt1->Items->get_CellCaption(TVariant(G2antt1->DrawPartItem),TVariant(0)) ); OutputDebugString( PChar(G2antt1->get_DrawPartKey()) ); } G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); var_Chart->LevelCount = 2; var_Chart->Bars->Add(L"OwnerDraw"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Draw-Item-Bar-1")),TVariant("OwnerDraw"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Draw-Item-Bar-2")),TVariant("OwnerDraw"),TVariant(TDateTime(2001,1,6).operator double()),TVariant(TDateTime(2001,1,9).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(0,TVariant("<*>"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarSelected,TVariant(true)); G2antt1->EndUpdate(); |
1674 |
Is it possible to show a status left or right to the bar (method 2, exBarFrameColor, EBN)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IAppearancePtr var_Appearance = G2antt1->VisualAppearance; var_Appearance->Add(2,TVariant(String("gBFLBCJwBAEHhEJAAChABP0IQAAYAQGKIaBoAKBQAGaAoDDYMQyQwAAxDOKsEwsACEIrjKCRShyCYZRrGUQyAKESRAGyTJBlKKodgOLYYSrFcgSIAsEhqGASRZGUBIJ") + "DEMI4AJPIwxNIDfyNGKWI6gOQKIoSCYlU7IED0fQNGxVF6XaYqYAIRDINQlVzXcQzPYEbRxCKLKppWqIfpuSIBgI=")); var_Appearance->Add(1,TVariant("CP:2 -8 -1 0 0")); var_Appearance->Add(3,TVariant("CP:2 0 -1 0 0")); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Red-Status-Outside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(16777471)); h = var_Items->AddItem(TVariant("Blue-Status-Outside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(33488896)); h = var_Items->AddItem(TVariant("Red-Status-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(50331903)); h = var_Items->AddItem(TVariant("Blue-Status-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(67043328)); G2antt1->EndUpdate(); |
1673 |
Is it possible to show a status left or right to the bar (method 1, exBarBackgroundExt)
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Red-Left-Status-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[6,back=RGB(255,0,0)]")); h = var_Items->AddItem(TVariant("Blue-Left-Status-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[6,back=RGB(0,0,255)]")); h = var_Items->AddItem(TVariant("Red-Right-Status-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("right[6,back=RGB(255,0,0)]")); h = var_Items->AddItem(TVariant("Blue-Right-Status-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("right[6,back=RGB(0,0,255)]")); G2antt1->EndUpdate(); |
1672 |
How can I use the ItemBar(exBarBackgroundExt) property for a bar
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 31; G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; G2antt1->GridLineColor = RGB(224,224,224); G2antt1->BackColorLevelHeader = G2antt1->BackColor; G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->get_Level(0)->GridLineColor = G2antt1->GridLineColor; var_Chart->get_Level(1)->GridLineColor = G2antt1->GridLineColor; var_Chart->ShowNonworkingDates = false; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); var_Chart->Bars->get_Item(TVariant("Task"))->Height = 21; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Normal")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K1"),TNoParam()); h = var_Items->AddItem(TVariant("Red-Frame-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("[frame=RGB(255,0,0),framethick]")); h = var_Items->AddItem(TVariant("LR-Margins")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[4,back=RGB(0,255,0)],right[4,back=RGB(0,0,255)]")); h = var_Items->AddItem(TVariant("LR-Margins (front)")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[4,back=RGB(0,255,0)],right[4,back=RGB(0,0,255)]")); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExtFlags,TVariant(2)); h = var_Items->AddItem(TVariant("LR-Margins (back)")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,8).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("left[4,back=RGB(0,255,0)],right[4,back=RGB(0,0,255)]")); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExtFlags,TVariant(3)); h = var_Items->AddItem(TVariant("TB-Margins")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,9).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("top[4,back=RGB(255,0,0)],bottom[4,back=RGB(0,255,0)]")); h = var_Items->AddItem(TVariant("TB-Margins")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,10).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("top[2,back=RGB(255,0,0)],bottom[2,back=RGB(0,255,0)]")); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExtFlags,TVariant(2)); h = var_Items->AddItem(TVariant("Caption(back)")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,11).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("client(bottom[14,text=`<sha ;;0><font ;8>background`,align=0x11])")); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExtFlags,TVariant(2)); h = var_Items->AddItem(TVariant("Pattern-Outside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("bottom[10%,pattern=7,frame]")); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExtFlags,TVariant(2)); h = var_Items->AddItem(TVariant("Pattern-Inside")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,13).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("bottom[7,pattern=3,frame]")); h = var_Items->AddItem(TVariant("Pattern-Inside-Caption")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant(String("top[4](left[4],right[4],client),bottom[4](left[4],right[4],client),left[4],right[4],client(left[75%,text=`<fgcolor FFFFFF>75%`,") + "align=0x11,pattern=0x001,frame=RGB(255,0,0)])")); h = var_Items->AddItem(TVariant("Complex(back)")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,11).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("top[30%,back=RGB(253,218,101)],client[back=RGB(91,157,210)],none[(0%,0%,10%,100%)](top[90%,back=RGB(0,0,0)])")); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExtFlags,TVariant(3)); h = var_Items->AddItem(TVariant("Complex(inside)")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarBackgroundExt,TVariant("top[30%,back=RGB(253,218,101)],client[back=RGB(91,157,210)],none[(0%,0%,10%,100%)](top[90%,back=RGB(0,0,0)])")); G2antt1->EndUpdate(); |
1671 |
How can display seconds
Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,96); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2008,1,17).operator double())); var_Chart->LevelCount = 2; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exSecond; var_Chart->get_Level(0)->Alignment = Exg2anttlib_tlb::AlignmentEnum::exHOutside | Exg2anttlib_tlb::AlignmentEnum::CenterAlignment; var_Chart->get_Level(1)->FormatLabel = L"(0:=sec(dvalue)) mod 10 ? 0=: : '<c><font ;6>sec<br><b>' + 0=:"; G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task 1")),TVariant("Task"),TVariant(TDateTime(2008,1,17,0,00,02,0).operator double()),TVariant(TDateTime(2008,1,17,0,00,08,0).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2008,1,17,0,00,05,0).operator double()),TVariant(TDateTime(2008,1,17,0,00,15,0).operator double()),TNoParam(),TNoParam()); |
1670 |
How can I check if an item contains a bar
// SelectionChanged event - Fired after a new item has been selected. void __fastcall TForm1::G2antt1SelectionChanged(TObject *Sender) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; OutputDebugString( L"Count of A: " ); OutputDebugString( PChar(var_Items->get_ItemBar(var_Items->FocusItem,TVariant("A"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarsCount)) ); OutputDebugString( L"Count of B: " ); OutputDebugString( PChar(var_Items->get_ItemBar(var_Items->FocusItem,TVariant("B"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarsCount)) ); OutputDebugString( L"Count of C: " ); OutputDebugString( PChar(var_Items->get_ItemBar(var_Items->FocusItem,TVariant("C"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarsCount)) ); } G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,48); var_Chart->Bars->get_Item(TVariant("Task"))->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(18)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("A"),TVariant("A")); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("B"),TVariant("B")); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("C"),TVariant("C")); G2antt1->EndUpdate(); |
1669 |
How can I connect to a DBF file
G2antt1->BeginUpdate(); G2antt1->ColumnAutoResize = false; G2antt1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADODB.Recordset"); rs->Open(TVariant("Select * From foxcode.DBF"),TVariant("Provider=vfpoledb;Data Source=C:\\Program Files\\Microsoft Visual FoxPro 9\\"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); G2antt1->DataSource = (IDispatch*)rs; G2antt1->Chart->set_PaneWidth(true,0); G2antt1->EndUpdate(); |
1668 |
How do I get the caption with no HTML format
G2antt1->Columns->Add(L"Default"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("This is a bit of <b>HTML-formatted</b> text")); var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exg2anttlib_tlb::ValueFormatEnum::exHTML); var_Items->AddItem(TVariant(var_Items->get_CellCaption(TVariant(h),TVariant(0)))); |
1667 |
How can I change the bar's color based on its length/duration
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Tasks"); Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Duration"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(513)); var_Column->Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SpinType; G2antt1->Items->AllowCellValueToItemBar = true; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,6).operator double())); var_Chart->set_PaneWidth(false,128); Exg2anttlib_tlb::IConditionalFormatPtr var_ConditionalFormat = G2antt1->ConditionalFormats->Add(L"%1 >= 4",TNoParam()); var_ConditionalFormat->ApplyTo = Exg2anttlib_tlb::FormatApplyToEnum(0x1); var_ConditionalFormat->Bold = true; var_ConditionalFormat->ApplyToBars = L"Task"; var_ConditionalFormat->BarColor = RGB(255,0,0); var_ConditionalFormat->ForeColor = var_ConditionalFormat->BarColor; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,13).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,11).operator double()),TVariant(TDateTime(2005,6,16).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,12).operator double()),TVariant(TDateTime(2005,6,15).operator double()),TVariant(""),TNoParam()); G2antt1->EndUpdate(); |
1666 |
Is it possible to colorize the bars based on its starting/ending date
G2antt1->BeginUpdate(); G2antt1->OnResizeControl = Exg2anttlib_tlb::OnResizeControlEnum::exDisableSplitter | Exg2anttlib_tlb::OnResizeControlEnum::exResizeChart; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Tasks"); Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Start"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); var_Column->Visible = false; G2antt1->Items->AllowCellValueToItemBar = true; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,5,31).operator double())); var_Chart->set_PaneWidth(false,0); var_Chart->AllowInsideZoom = true; var_Chart->AllowResizeInsideZoom = false; var_Chart->InsideZoomOnDblClick = false; Exg2anttlib_tlb::IInsideZoomFormatPtr var_InsideZoomFormat = var_Chart->DefaultInsideZoomFormat; var_InsideZoomFormat->PatternChart = Exg2anttlib_tlb::PatternEnum::exPatternBDiagonal; var_InsideZoomFormat->PatternColorChart = RGB(255,0,0); var_InsideZoomFormat->ForeColor = var_InsideZoomFormat->PatternColorChart; Exg2anttlib_tlb::IInsideZoomsPtr var_InsideZooms = var_Chart->InsideZooms; var_InsideZooms->SplitBaseLevel = false; var_InsideZooms->DefaultWidth = 18; var_InsideZooms->Add(TVariant(TDateTime(2005,6,10).operator double()))->AllowInsideFormat = false; Exg2anttlib_tlb::IConditionalFormatPtr var_ConditionalFormat = G2antt1->ConditionalFormats->Add(L"%1 <= #6/10/2005#",TNoParam()); var_ConditionalFormat->ApplyToBars = L"Task"; var_ConditionalFormat->BarColor = RGB(255,0,0); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,14).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,11).operator double()),TVariant(TDateTime(2005,6,15).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,12).operator double()),TVariant(TDateTime(2005,6,16).operator double()),TVariant(""),TNoParam()); G2antt1->EndUpdate(); |
1665 |
How can I change the bar's color based on values on the columns
// AddItem event - Occurs after a new Item has been inserted to Items collection. void __fastcall TForm1::G2antt1AddItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(Item,TVariant("Task"),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(2))),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(4))),TNoParam(),TNoParam()); } G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(1994,8,3).operator double())); var_Chart->set_PaneWidth(false,256); var_Chart->LevelCount = 2; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exDay; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->OverviewVisible = Exg2anttlib_tlb::OverviewVisibleEnum::exOverviewShowAllVisible; G2antt1->ColumnAutoResize = false; G2antt1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); G2antt1->DataSource = (IDispatch*)rs; G2antt1->Items->AllowCellValueToItemBar = true; G2antt1->Columns->get_Item(TVariant(2))->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); G2antt1->Columns->get_Item(TVariant(4))->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(2)); Exg2anttlib_tlb::IConditionalFormatsPtr var_ConditionalFormats = G2antt1->ConditionalFormats; Exg2anttlib_tlb::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"1",TNoParam()); var_ConditionalFormat->ApplyTo = Exg2anttlib_tlb::FormatApplyToEnum(0x1); var_ConditionalFormat->Bold = true; var_ConditionalFormat->BackColor = RGB(250,250,250); Exg2anttlib_tlb::IConditionalFormatPtr var_ConditionalFormat1 = var_ConditionalFormats->Add(L"%1 = 5",TNoParam()); var_ConditionalFormat1->ApplyToBars = L"Task"; var_ConditionalFormat1->BarColor = RGB(255,0,0); var_ConditionalFormat1->ForeColor = RGB(255,0,0); var_ConditionalFormat1->BarOverviewColor = RGB(255,0,0); Exg2anttlib_tlb::IConditionalFormatPtr var_ConditionalFormat2 = var_ConditionalFormats->Add(L"%1 = 3",TNoParam()); var_ConditionalFormat2->ApplyToBars = L"Task"; var_ConditionalFormat2->BarColor = RGB(0,255,0); var_ConditionalFormat2->ForeColor = RGB(0,255,0); var_ConditionalFormat2->BarOverviewColor = RGB(0,255,0); G2antt1->EndUpdate(); |
1664 |
How can I display / specify a fixed percent for the task in the histogram, no matter how long the task is
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 32; G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->UnitWidth = 32; var_Chart->LevelCount = 2; var_Chart->NonworkingDays = 0; var_Chart->set_PaneWidth(false,64); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,20).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 64; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverAllocation; var_Bar->ShowHistogramValues = L"1"; Exg2anttlib_tlb::IBarPtr var_Bar1 = var_Chart->Bars->Copy(L"Task",L"TaskFixed"); var_Bar1->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverAllocationFixed | Exg2anttlib_tlb::HistogramTypeEnum::exHistOverAllocation; var_Bar1->ShowHistogramValues = L"1"; Exg2anttlib_tlb::IBarPtr var_Bar2 = var_Chart->Bars->Copy(L"Task",L"TaskMultiply"); var_Bar2->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverAllocationMultiply | Exg2anttlib_tlb::HistogramTypeEnum::exHistOverAllocation; var_Bar2->ShowHistogramValues = L"1"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Allocation")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,21).operator double()),TVariant(TDateTime(2005,6,23).operator double()),TVariant("A"),TVariant("Effort/Length")); var_Items->set_ItemBar(h,TVariant("A"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(0.25)); var_Items->set_ItemBar(h,TVariant("A"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarVAlignCaption,TVariant(18)); var_Items->AddBar(h,TVariant("TaskFixed"),TVariant(TDateTime(2005,6,24).operator double()),TVariant(TDateTime(2005,6,26).operator double()),TVariant("B"),TVariant("Effort")); var_Items->set_ItemBar(h,TVariant("B"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(0.25)); var_Items->set_ItemBar(h,TVariant("B"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarVAlignCaption,TVariant(18)); var_Items->AddBar(h,TVariant("TaskMultiply"),TVariant(TDateTime(2005,6,27).operator double()),TVariant(TDateTime(2005,6,29).operator double()),TVariant("C"),TVariant("Effort*Length")); var_Items->set_ItemBar(h,TVariant("C"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(0.25)); var_Items->set_ItemBar(h,TVariant("C"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarVAlignCaption,TVariant(18)); G2antt1->EndUpdate(); |
1663 |
Does your control supports scrolling by touching the screen
// AddItem event - Occurs after a new Item has been inserted to Items collection. void __fastcall TForm1::G2antt1AddItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(Item,TVariant("Task"),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(2))),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(4))),TNoParam(),TNoParam()); } G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(1994,8,3).operator double())); var_Chart->set_PaneWidth(false,256); var_Chart->LevelCount = 2; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exDay; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->OverviewVisible = Exg2anttlib_tlb::OverviewVisibleEnum::exOverviewShowAllVisible; G2antt1->ColumnAutoResize = false; G2antt1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); G2antt1->DataSource = (IDispatch*)rs; G2antt1->Items->AllowCellValueToItemBar = true; G2antt1->Columns->get_Item(TVariant(2))->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); G2antt1->Columns->get_Item(TVariant(4))->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(2)); G2antt1->ContinueColumnScroll = true; G2antt1->ScrollBySingleLine = true; G2antt1->Chart->AllowCreateBar = Exg2anttlib_tlb::CreateBarEnum::exNoCreateBar; G2antt1->AutoDrag = Exg2anttlib_tlb::AutoDragEnum::exAutoDragScrollOnShortTouch | Exg2anttlib_tlb::AutoDragEnum::exAutoDragScroll; G2antt1->EndUpdate(); |
1662 |
Is it possible to use build-in zoom-functionality to zoom time periods spanning to just some hours of one day (zoom-onfly)
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exDay; var_Chart->set_PaneWidth(false,0); var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; var_Chart->AllowZoomOnFly = Exg2anttlib_tlb::ZoomOnFlyEnum::exZoomOnFly; var_Chart->ResizeUnitScale = Exg2anttlib_tlb::UnitEnum::exHour; var_Chart->ResizeUnitCount = 4; var_Chart->set_Label(Exg2anttlib_tlb::UnitEnum::exHour,L"<font ;5><b><%h%><br><%AM/PM%></b></font><||>4<||>65536"); var_Chart->ZoomOnFlyCaption = L"<br><c><b><font ;12><%=%C0%>"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,7).operator double()),TVariant(TDateTime(2001,1,10).operator double()),TVariant("T1"),TVariant("T1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,11).operator double()),TVariant(TDateTime(2001,1,14).operator double()),TVariant("T3"),TVariant("T3")); h = var_Items->AddItem(TNoParam()); var_Items->AddBar(h,TVariant(""),TVariant(TDateTime(2001,1,15).operator double()),TVariant(TDateTime(2001,1,15).operator double()),TVariant(""),TVariant("Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.")); var_Items->set_SelectableItem(h,false); G2antt1->EndUpdate(); |
1661 |
Is it possible to use build-in zoom-functionality to zoom time periods spanning to just some hours of one day (inside-zoom)
|
1660 |
How can I export the control's content to a PDF document (method 1)
G2antt1->BeginUpdate(); G2antt1->MarkSearchColumn = false; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Tasks"); Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Start"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); var_Column->Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SpinType; Exg2anttlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"End"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(2)); var_Column1->Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SpinType; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,196); var_Chart->LevelCount = 2; var_Chart->ShowEmptyBars = 1; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2009,1,1).operator double())); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AllowCellValueToItemBar = true; var_Items->AddBar(var_Items->AddItem(TVariant("Task 1")),TVariant("Task"),TVariant(TDateTime(2009,1,2).operator double()),TVariant(TDateTime(2009,1,7).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2009,1,4).operator double()),TVariant(TDateTime(2009,1,9).operator double()),TNoParam(),TNoParam()); /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: ExPrint 1.0 Control Library TypeLib: ExPrint.dll to define the namespace: Exprintlib_tlb */ //#include "EXPRINTLIB_TLB.h" Exprintlib_tlb::IExPrintPtr var_Print = Variant::CreateObject(L"Exontrol.Print"); var_Print->PrintExt = (IUnknown*)G2antt1->DefaultDispatch; var_Print->CopyTo(L"c:/temp/xtest.pdf"); OutputDebugString( L"Look for C:\\Temp\\xtest.pdf file." ); G2antt1->EndUpdate(); |
1659 |
How can I export the control's content to a PDF document (method 2)
G2antt1->BeginUpdate(); G2antt1->MarkSearchColumn = false; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Tasks"); Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Start"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); var_Column->Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SpinType; Exg2anttlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"End"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(2)); var_Column1->Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SpinType; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,196); var_Chart->LevelCount = 2; var_Chart->ShowEmptyBars = 1; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2009,1,1).operator double())); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AllowCellValueToItemBar = true; var_Items->AddBar(var_Items->AddItem(TVariant("Task 1")),TVariant("Task"),TVariant(TDateTime(2009,1,2).operator double()),TVariant(TDateTime(2009,1,7).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2009,1,4).operator double()),TVariant(TDateTime(2009,1,9).operator double()),TNoParam(),TNoParam()); TVariant var_CopyTo = TVariant(G2antt1->CopyTo[L"c:/temp/xtest.pdf"]); OutputDebugString( L"Look for C:\\Temp\\xtest.pdf file." ); G2antt1->EndUpdate(); |
1658 |
Today date is shown, if we use the Column.FormatColumn and Editor.Option(exDateAllowNullDate) properties. What can be done
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Date"); var_Column->FormatColumn = TVariant(String("len(value) ? ( (longdate(date(value)) left 3) + ' ' + day(date(value)) + '/' + month(date(value)) + '/' + (year(date(value)) ri") + "ght 2) ) : '' )"); Exg2anttlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::DateType; var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exDateAllowNullDate,TVariant(true)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant(TDateTime(2012,5,12).operator double())); var_Items->AddItem(TNoParam()); var_Items->AddItem(TVariant(TDateTime(2012,5,14).operator double())); G2antt1->EndUpdate(); |
1657 |
Is there a syntax for conditional formatting of items, based on CellState/CellStateChange
// CellStateChanged event - Fired after cell's state has been changed. void __fastcall TForm1::G2antt1CellStateChanged(TObject *Sender,Exg2anttlib_tlb::HITEM Item,long ColIndex) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellValue(TVariant(Item),TVariant(2),TVariant(var_Items->get_CellState(TVariant(Item),TVariant(0)))); } G2antt1->BeginUpdate(); G2antt1->ShowFocusRect = false; G2antt1->SelBackMode = Exg2anttlib_tlb::BackModeEnum::exTransparent; Exg2anttlib_tlb::IConditionalFormatPtr var_ConditionalFormat = G2antt1->ConditionalFormats->Add(L"%2 != 0",TNoParam()); var_ConditionalFormat->Bold = true; var_ConditionalFormat->ForeColor = RGB(255,0,0); var_ConditionalFormat->ApplyTo = Exg2anttlib_tlb::FormatApplyToEnum::exFormatToItems; Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L""); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); var_Column->Width = 16; var_Column->AllowSizing = false; G2antt1->Columns->Add(L"Information"); G2antt1->Columns->Add(L"Hidden")->Visible = false; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(""))),TVariant(1),TVariant("This is a bit of text associated")); long h = var_Items->AddItem(TVariant("")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("This is a bit of text associated")); var_Items->set_CellState(TVariant(h),TVariant(0),1); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(""))),TVariant(1),TVariant("This is a bit of text associated")); G2antt1->EndUpdate(); |
1656 |
How can I hide the items/grid section of the control
G2antt1->BeginUpdate(); G2antt1->OnResizeControl = Exg2anttlib_tlb::OnResizeControlEnum::exDisableSplitter | Exg2anttlib_tlb::OnResizeControlEnum::exResizeChart; G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,9).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 128; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Chart->set_PaneWidth(false,0); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,14).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,11).operator double()),TVariant(TDateTime(2005,6,15).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,12).operator double()),TVariant(TDateTime(2005,6,16).operator double()),TVariant(""),TNoParam()); G2antt1->EndUpdate(); |
1655 |
How can I draw an extra line which could indicate deadline for my tasks
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 24; Exg2anttlib_tlb::IAppearancePtr var_Appearance = G2antt1->VisualAppearance; var_Appearance->Add(2,TVariant(String("gBFLBCJwBAEHhEJAAChABLMIQAAYAQGKIaBoAKBQAGaAoDDQOQ4QwAAxjAKUEwsACEIrjKCYVgOHYYRrIIEvZAAMIlSbCMoxcAsSQSf6YJBmKL4fiWMobRCMQyiLLMd") + "wiGoYJ4hGgKChqI43RZNErURRkEwCgIA=")); var_Appearance->Add(1,TVariant("CP:2 0 -4 0 4")); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,128); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Default")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K1"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(16777471)); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,9).operator double()),TVariant(TDateTime(2001,1,14).operator double()),TVariant("K2"),TNoParam()); var_Items->set_ItemBar(h,TVariant("K2"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(33488896)); G2antt1->EndUpdate(); |
1654 |
How can I mark/highlight a zone in the control's histogram
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,40); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,9).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 128; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar->HistogramItems = 12; var_Bar->HistogramRulerLinesColor = RGB(0,0,1); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,14).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,11).operator double()),TVariant(TDateTime(2005,6,15).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,12).operator double()),TVariant(TDateTime(2005,6,16).operator double()),TVariant(""),TNoParam()); G2antt1->Chart->MarkTimeZone(TVariant("zone"),TVariant(TDateTime(2005,6,13).operator double()),TVariant(TDateTime(2005,6,14).operator double()),TVariant(15790320),TVariant(";;;;histogram;1")); G2antt1->EndUpdate(); |
1653 |
How can I get the min/max values from the histogram
// MouseMove event - Occurs when the user moves the mouse. void __fastcall TForm1::G2antt1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y) { Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; OutputDebugString( L"Value" ); OutputDebugString( PChar(var_Chart->get_HistogramValue(TVariant(var_Chart->get_DateFromPoint(-1,-1)),TNoParam(),TNoParam())) ); OutputDebugString( L"MIN" ); OutputDebugString( PChar(var_Chart->get_HistogramValue(TVariant("min"),TNoParam(),TNoParam())) ); OutputDebugString( L"MAX" ); OutputDebugString( PChar(var_Chart->get_HistogramValue(TVariant("max"),TNoParam(),TNoParam())) ); } G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,40); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,9).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 128; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar->HistogramItems = 12; var_Bar->HistogramRulerLinesColor = RGB(0,0,1); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,14).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,11).operator double()),TVariant(TDateTime(2005,6,15).operator double()),TVariant(""),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task")),TVariant("Task"),TVariant(TDateTime(2005,6,12).operator double()),TVariant(TDateTime(2005,6,16).operator double()),TVariant(""),TNoParam()); G2antt1->EndUpdate(); |
1652 |
How can I assign different efforts(expression) to the same bar
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,40); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,9).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 128; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar->HistogramItems = 12; var_Bar->HistogramRulerLinesColor = RGB(0,0,1); var_Chart->get_Level(1)->set_Label(TVariant("<font ;3><%d%>")); var_Chart->UnitWidth = 9; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,14).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("weekday(value) in (0,6) ? 0.25 : 2")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,18).operator double()),TVariant(TDateTime(2005,6,21).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("weekday(value) = 1 ? 2 : 1")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,27).operator double()),TVariant(TDateTime(2005,7,9).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("month (value) = 7 ? 1 : 0")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,27).operator double()),TVariant(TDateTime(2005,7,5).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("(month(value)=month(value+1)) ? 1 : 0")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,22).operator double()),TVariant(TDateTime(2005,6,26).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("int(value-start) ? 1 : 2")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,7,10).operator double()),TVariant(TDateTime(2005,7,14).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("(int(value-start) and int(end-value) != 0 ) ? 1 : 2")); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,7,15).operator double()),TVariant(TDateTime(2005,7,22).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("(int(value-start)+1) mod 2 ? 1 : 0")); G2antt1->EndUpdate(); |
1651 |
How can I prevent showing the representation of the bar on the week days, nonworking part
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->set_PaneWidth(false,40); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,9).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->HistogramHeight = 128; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar->HistogramItems = 12; var_Bar->HistogramRulerLinesColor = RGB(0,0,1); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,10).operator double()),TVariant(TDateTime(2005,6,21).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("weekday(value) in (0,6) ? 0 : 2")); G2antt1->EndUpdate(); |
1650 |
How do I programatically focus a cell
// FocusChanged event - Occurs when a cell gets the focus. void __fastcall TForm1::G2antt1FocusChanged(TObject *Sender) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellBackColor(TVariant(var_Items->FocusItem),TVariant(G2antt1->FocusColumnIndex),RGB(255,0,0)); } G2antt1->BeginUpdate(); G2antt1->SelForeColor = G2antt1->ForeColor; G2antt1->SelBackColor = G2antt1->BackColor; G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exRowLines; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Column1"); var_Columns->Add(L"Column2"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Cell 1.1"))),TVariant(1),TVariant("Cell 1.2")); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Cell 2.1"))),TVariant(1),TVariant("Cell 2.2")); Exg2anttlib_tlb::IItemsPtr var_Items1 = G2antt1->Items; var_Items1->set_SelectItem(var_Items1->get_ItemByIndex(1),true); G2antt1->FocusColumnIndex = 1; G2antt1->EndUpdate(); |
1649 |
How do I programatically focus a cell (excrd)
// FocusChanged event - Occurs when a cell gets the focus. void __fastcall TForm1::G2antt1FocusChanged(TObject *Sender) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellBackColor(TVariant(var_Items->FocusItem),TVariant(G2antt1->FocusColumnIndex),RGB(255,0,0)); } G2antt1->BeginUpdate(); G2antt1->SelForeColor = G2antt1->ForeColor; G2antt1->SelBackColor = G2antt1->BackColor; G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exRowLines; G2antt1->DefaultItemHeight = 36; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Column1")->Visible = false; var_Columns->Add(L"Column2")->Visible = false; var_Columns->Add(L"Column3")->Visible = false; Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"FormatLevel"); var_Column->FormatLevel = L"(0/1),2"; var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellFormatLevel,TVariant(var_Column->FormatLevel)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Cell 1.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 1.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 1.3")); h = var_Items->AddItem(TVariant("Cell 2.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 2.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 2.3")); Exg2anttlib_tlb::IItemsPtr var_Items1 = G2antt1->Items; var_Items1->set_SelectItem(var_Items1->get_ItemByIndex(1),true); G2antt1->FocusColumnIndex = 2; G2antt1->EndUpdate(); |
1648 |
How can I get task's user data ( exBarData ) when user double clicks the bar
// DblClick event - Occurs when the user dblclk the left mouse button over an object. void __fastcall TForm1::G2antt1DblClick(TObject *Sender,short Shift,int X,int Y) { long item = G2antt1->ItemFromPoint[-1,-1,c,hit]; TVariant key = TVariant(G2antt1->Chart->get_BarFromPoint(-1,-1)); OutputDebugString( PChar(G2antt1->Items->get_ItemBar(item,TVariant(key),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarData)) ); } G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); G2antt1->Chart->set_PaneWidth(false,48); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarData,TVariant("this is a bit of extra data associated with task 1")); h = var_Items->AddItem(TVariant("Task 2")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarData,TVariant("this is a bit of extra data associated with task 2")); G2antt1->EndUpdate(); |
1647 |
How do I get arranged the levels to display, weeks, days and so on
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->UnitWidth = 24; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,0); var_Chart->LevelCount = 2; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; Exg2anttlib_tlb::ILevelPtr var_Level = var_Chart->get_Level(0); var_Level->Alignment = Exg2anttlib_tlb::AlignmentEnum::CenterAlignment; var_Level->set_Label(TVariant("<b><Font Tahoma;7><%m3%>, <%yyyy%></b><b>, <Font Tahoma;7>Wk <%ww%>")); var_Level->Unit = Exg2anttlib_tlb::UnitEnum::exWeek; var_Level->DrawGridLines = true; Exg2anttlib_tlb::ILevelPtr var_Level1 = var_Chart->get_Level(1); var_Level1->Alignment = Exg2anttlib_tlb::AlignmentEnum::CenterAlignment; var_Level1->set_Label(TVariant("<Font Tahoma;7><%d%>")); var_Level1->Unit = Exg2anttlib_tlb::UnitEnum::exDay; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; G2antt1->EndUpdate(); |
1646 |
How can I add a task and a milestone to the same item
G2antt1->Columns->Add(L"Task"); G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Milestone"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,2).operator double()),TVariant("MKey"),TNoParam()); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); |
1645 |
How can I change the visual appearance of the buttons on the control's overview part
|
1644 |
Is there a way to show the Start and End dates in mm-dd-yyyy format
G2antt1->BeginUpdate(); G2antt1->MarkSearchColumn = false; G2antt1->Items->AllowCellValueToItemBar = true; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2000,12,25).operator double())); var_Chart->set_PaneWidth(false,196); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Start"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarKey,TVariant("K1")); var_Column->FormatColumn = L"(0 array (0:=(shortdateF(value) split `/`))) + `-` + (1 array (=:0) ) + `-` + (2 array (=:0) )"; Exg2anttlib_tlb::IColumnPtr var_Column1 = G2antt1->Columns->Add(L"End"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(2)); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarKey,TVariant("K1")); var_Column1->FormatColumn = L"shortdateF(value) replace `/` with `-`"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TNoParam()),TVariant("Task"),TVariant(TDateTime(2001,1,1).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TNoParam()),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); G2antt1->EndUpdate(); |
1643 |
Is there a way to show the Start and End dates in dd-mm-yyyy format
G2antt1->BeginUpdate(); G2antt1->MarkSearchColumn = false; G2antt1->Items->AllowCellValueToItemBar = true; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2000,12,25).operator double())); var_Chart->set_PaneWidth(false,196); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Start"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(1)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarKey,TVariant("K1")); var_Column->FormatColumn = L"(1 array (0:=(shortdateF(value) split `/`))) + `-` + (0 array (=:0) ) + `-` + (2 array (=:0) )"; Exg2anttlib_tlb::IColumnPtr var_Column1 = G2antt1->Columns->Add(L"End"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(2)); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarKey,TVariant("K1")); var_Column1->FormatColumn = L"(1 array (0:=(shortdateF(value) split `/`))) + `-` + (0 array (=:0) ) + `-` + (2 array (=:0) )"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TNoParam()),TVariant("Task"),TVariant(TDateTime(2001,1,1).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant("K1"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TNoParam()),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TNoParam()); G2antt1->EndUpdate(); |
1642 |
If we have bars with dark color, we use white font/color. But if the bars are too small for the caption, you cant read it. What can we do
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(2000,12,29).operator double())); G2antt1->Chart->set_PaneWidth(false,48); Exg2anttlib_tlb::IBarPtr var_Bar = G2antt1->Chart->Bars->get_Item(TVariant("Task")); var_Bar->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar->Height = 17; Exg2anttlib_tlb::IBarPtr var_Bar1 = G2antt1->Chart->Bars->get_Item(TVariant("Progress")); var_Bar1->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar1->Height = 17; var_Bar1->Shape = Exg2anttlib_tlb::ShapeBarEnum::exShapeSolid; var_Bar1->Color = RGB(0,0,255); Exg2anttlib_tlb::IBarPtr var_Bar2 = G2antt1->Chart->Bars->Add(L"Task%Progress"); var_Bar2->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar2->Height = 17; var_Bar2->Shortcut = L"Percent"; G2antt1->DefaultItemHeight = 21; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,5).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(4112616)); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF><sha 0;;0>Pause")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,9).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TVariant("white"),TNoParam()); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(4112616)); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF>Pause")); h = var_Items->AddItem(TVariant("Task 2")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(2017557)); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF><sha 0;;0>Production")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,10).operator double()),TVariant(TDateTime(2001,1,11).operator double()),TVariant("white"),TNoParam()); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(2017557)); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF>Production")); h = var_Items->AddItem(TVariant("Task 3")); var_Items->AddBar(h,TVariant("Percent"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarPercent,TVariant(0.5)); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(2017557)); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF><sha 0;;0>Pausing")); var_Items->AddBar(h,TVariant("Percent"),TVariant(TDateTime(2001,1,10).operator double()),TVariant(TDateTime(2001,1,11).operator double()),TVariant("white"),TNoParam()); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarPercent,TVariant(0.5)); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(2017557)); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF>Pausing")); h = var_Items->AddItem(TVariant("Task 4")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant(""),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(8421504)); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF><sha 0;;0>Planned downtime")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,10).operator double()),TVariant(TDateTime(2001,1,11).operator double()),TVariant("white"),TNoParam()); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(8421504)); var_Items->set_ItemBar(h,TVariant("white"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarCaption,TVariant("<fgcolor=FFFFFF>Planned downtime")); G2antt1->EndUpdate(); |
1641 |
How do I programmatically exclude items from the filter
G2antt1->BeginUpdate(); G2antt1->LinesAtRoot = Exg2anttlib_tlb::LinesAtRootEnum::exLinesAtRoot; Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Items"); var_Column->DisplayFilterButton = true; var_Column->DisplayFilterPattern = false; var_Column->FilterList = Exg2anttlib_tlb::FilterListEnum::exShowExclude | Exg2anttlib_tlb::FilterListEnum::exShowFocusItem | Exg2anttlib_tlb::FilterListEnum::exShowCheckBox; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); var_Items->AddItem(TVariant("Item 3")); var_Items->AddItem(TVariant("Item 4")); Exg2anttlib_tlb::IColumnPtr var_Column1 = G2antt1->Columns->get_Item(TVariant(0)); var_Column1->FilterType = Exg2anttlib_tlb::FilterTypeEnum::exFilterExclude | Exg2anttlib_tlb::FilterTypeEnum::exFilter; var_Column1->Filter = L"Item 1|Item 4"; G2antt1->ApplyFilter(); G2antt1->EndUpdate(); |
1640 |
How do I show in histogram, more values for a single task
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). void __fastcall TForm1::G2antt1BeforeExpandItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item,Variant * Cancel) { Cancel = true; } G2antt1->BeginUpdate(); G2antt1->SingleSel = true; G2antt1->ExpandOnDblClick = false; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->AllowLinkBars = false; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2000,12,29).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 167; var_Chart->set_PaneWidth(false,128); var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramNoGrouping | Exg2anttlib_tlb::HistogramViewEnum::exHistogramUnlockedItems; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistCumulative; var_Bar->HistogramItems = 6; var_Bar->HistogramPattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar->HistogramItems = -40000; var_Bar->HistogramCriticalValue = 100000; var_Bar->HistogramRulerLinesColor = RGB(128,128,128); var_Bar->HistogramCumulativeColors = 3; var_Chart->ShowNonworkingDates = false; G2antt1->Columns->Add(L"Costs")->Visible = false; G2antt1->Columns->Add(L"Tasks")->Visible = true; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Estimated")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,1).operator double()),TVariant(TDateTime(2001,1,10).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(8000)); long hR = var_Items->InsertItem(h,TNoParam(),TVariant("Actual")); var_Items->AddBar(hR,TVariant("Task"),TVariant(TDateTime(2001,1,1).operator double()),TVariant(TDateTime(2001,1,10).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(hR,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(9000)); var_Items->GroupBars(h,TVariant(""),true,hR,TVariant(""),true,TNoParam(),TNoParam()); var_Items->GroupBars(h,TVariant(""),false,hR,TVariant(""),false,TNoParam(),TNoParam()); hR = var_Items->InsertItem(h,TNoParam(),TVariant("Cost")); var_Items->AddBar(hR,TVariant("Task"),TVariant(TDateTime(2001,1,1).operator double()),TVariant(TDateTime(2001,1,10).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(hR,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(200)); var_Items->GroupBars(h,TVariant(""),true,hR,TVariant(""),true,TNoParam(),TNoParam()); var_Items->GroupBars(h,TVariant(""),false,hR,TVariant(""),false,TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("Estimated")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Task 2")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,9).operator double()),TVariant(TDateTime(2001,1,15).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(7000)); hR = var_Items->InsertItem(h,TNoParam(),TVariant("Actual")); var_Items->AddBar(hR,TVariant("Task"),TVariant(TDateTime(2001,1,9).operator double()),TVariant(TDateTime(2001,1,15).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(hR,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(8000)); var_Items->GroupBars(h,TVariant(""),true,hR,TVariant(""),true,TNoParam(),TNoParam()); var_Items->GroupBars(h,TVariant(""),false,hR,TVariant(""),false,TNoParam(),TNoParam()); hR = var_Items->InsertItem(h,TNoParam(),TVariant("Cost")); var_Items->AddBar(hR,TVariant("Task"),TVariant(TDateTime(2001,1,9).operator double()),TVariant(TDateTime(2001,1,15).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(hR,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant(150)); var_Items->GroupBars(h,TVariant(""),true,hR,TVariant(""),true,TNoParam(),TNoParam()); var_Items->GroupBars(h,TVariant(""),false,hR,TVariant(""),false,TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1639 |
How can I align the caption of the bar
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2000,12,25).operator double())); var_Chart->set_PaneWidth(false,48); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("exBarHAlignCaption = 0")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(0)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("exBarHAlignCaption = 1")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(1)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("exBarHAlignCaption = 2")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(2)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("Clip 3")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(3)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("Clip 4")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(4)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("Clip 5")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(5)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("Outside Left 16")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(16)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("Outside Right 18")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(18)); h = var_Items->AddItem(TVariant("Task")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K"),TVariant("Outside Center 17")); var_Items->set_ItemBar(h,TVariant("K"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarHAlignCaption,TVariant(17)); G2antt1->EndUpdate(); |
1638 |
How can I change the drop down filter background color
G2antt1->BeginUpdate(); G2antt1->LinesAtRoot = Exg2anttlib_tlb::LinesAtRootEnum::exLinesAtRoot; G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exBackColorFilter] = RGB(255,255,255); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Items"); var_Column->DisplayFilterButton = true; var_Column->DisplayFilterPattern = false; var_Column->FilterList = Exg2anttlib_tlb::FilterListEnum::exShowFocusItem | Exg2anttlib_tlb::FilterListEnum::exShowCheckBox | Exg2anttlib_tlb::FilterListEnum::exSortItemsAsc | Exg2anttlib_tlb::FilterListEnum::exLeafItems; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Root 1")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 1")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 2")); var_Items->set_ExpandItem(h,true); h = var_Items->AddItem(TVariant("Root 2")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 1")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 2")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 3")); var_Items->set_ExpandItem(h,true); G2antt1->EndUpdate(); |
1637 |
How can I arrange the columns using CRD (eXCRD ) strings (Sample 2)
G2antt1->BeginUpdate(); G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; G2antt1->DefaultItemHeight = 36; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"C1"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); var_Column->Width = 18; var_Column->AllowSizing = false; Exg2anttlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"C2"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); var_Column1->Width = 18; var_Columns->Add(L"Column1")->Visible = false; var_Columns->Add(L"Column2")->Visible = false; var_Columns->Add(L"Column3")->Visible = false; Exg2anttlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"FormatLevel"); var_Column2->FormatLevel = L"18;\"Info\"[a=17]/(2/3,4)"; var_Column2->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellFormatLevel,TVariant("2/3,4")); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2014,6,22).operator double())); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Cell 1.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 1.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 1.3")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2014,6,23).operator double()),TVariant(TDateTime(2014,6,25).operator double()),TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("Cell 2.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 2.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 2.3")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2014,6,26).operator double()),TVariant(TDateTime(2014,6,28).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1636 |
How can I arrange the columns using CRD (eXCRD ) strings (Sample 1)
G2antt1->BeginUpdate(); G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; G2antt1->DefaultItemHeight = 36; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Column1")->Visible = false; var_Columns->Add(L"Column2")->Visible = false; var_Columns->Add(L"Column3")->Visible = false; Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"FormatLevel"); var_Column->FormatLevel = L"(0/1),2"; var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellFormatLevel,TVariant(var_Column->FormatLevel)); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2014,6,22).operator double())); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Cell 1.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 1.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 1.3")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2014,6,23).operator double()),TVariant(TDateTime(2014,6,25).operator double()),TNoParam(),TNoParam()); h = var_Items->AddItem(TVariant("Cell 2.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 2.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 2.3")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2014,6,26).operator double()),TVariant(TDateTime(2014,6,28).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1635 |
How do I display the histogram for filtered items only
G2antt1->BeginUpdate(); G2antt1->SingleSel = false; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->LevelCount = 2; var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 32; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramFilteredItems; var_Chart->Bars->get_Item(TVariant("Task"))->HistogramPattern = Exg2anttlib_tlb::PatternEnum::exPatternBDiagonal; Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Column"); var_Column->DisplayFilterButton = true; var_Column->Filter = L"Item 1"; var_Column->FilterType = Exg2anttlib_tlb::FilterTypeEnum::exFilter; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Item 1")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Item 2")),TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); G2antt1->ApplyFilter(); G2antt1->EndUpdate(); |
1634 |
How can I use no scroll bars for touch-screens
// AddItem event - Occurs after a new Item has been inserted to Items collection. void __fastcall TForm1::G2antt1AddItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(Item,TVariant("Task"),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(2))),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(4))),TNoParam(),TNoParam()); } // MouseMove event - Occurs when the user moves the mouse. void __fastcall TForm1::G2antt1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y) { G2antt1->ShowToolTip(L"<font ;6><sha ;;0><off -4>Tip</off></sha></font> If the cursor hovers bars, click and wait for a second to start scrolling.",TNoParam(),TNoParam(),TNoParam(),TNoParam()); } G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->AllowCreateBar = Exg2anttlib_tlb::CreateBarEnum::exNoCreateBar; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(1994,8,3).operator double())); var_Chart->set_PaneWidth(false,256); var_Chart->LevelCount = 2; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exDay; var_Chart->FirstWeekDay = Exg2anttlib_tlb::WeekDayEnum::exMonday; var_Chart->OverviewVisible = Exg2anttlib_tlb::OverviewVisibleEnum::exOverviewShowAllVisible; G2antt1->ColumnAutoResize = false; G2antt1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); G2antt1->DataSource = (IDispatch*)rs; G2antt1->AutoDrag = Exg2anttlib_tlb::AutoDragEnum::exAutoDragScroll; G2antt1->ScrollWidth = 4; G2antt1->ScrollHeight = 4; G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exHSLeft] = RGB(192,192,192); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exHSRight] = RGB(192,192,192); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exHSBack] = RGB(224,224,224); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exHSThumb] = RGB(128,128,128); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exVSBack] = RGB(224,224,224); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exVSDown] = RGB(192,192,192); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exVSThumb] = RGB(128,128,128); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exVSUp] = RGB(192,192,192); G2antt1->ScrollButtonWidth = 0; G2antt1->ScrollButtonHeight = 0; G2antt1->EndUpdate(); |
1633 |
How can I display values in the histogram legend
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Effort"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(21)); var_Column->Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SpinType; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->NonworkingDays = 0; var_Chart->set_PaneWidth(false,96); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,20).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 128; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverload; var_Bar->HistogramCriticalValue = 3; var_Bar->HistogramItems = -7; var_Bar->HistogramGridLinesColor = RGB(192,192,192); var_Bar->HistogramRulerLinesColor = RGB(0,0,1); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AllowCellValueToItemBar = true; long h1 = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h1,TVariant("Task"),TVariant(TDateTime(2005,6,21).operator double()),TVariant(TDateTime(2005,6,23).operator double()),TNoParam(),TNoParam()); var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(4)); h1 = var_Items->AddItem(TVariant("Task 2")); var_Items->AddBar(h1,TVariant("Task"),TVariant(TDateTime(2005,6,24).operator double()),TVariant(TDateTime(2005,6,26).operator double()),TNoParam(),TNoParam()); var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(3)); h1 = var_Items->AddItem(TVariant("Task 3")); var_Items->AddBar(h1,TVariant("Task"),TVariant(TDateTime(2005,6,27).operator double()),TVariant(TDateTime(2005,6,29).operator double()),TNoParam(),TNoParam()); var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2)); h1 = var_Items->AddItem(TVariant("Task 4")); var_Items->AddBar(h1,TVariant("Task"),TVariant(TDateTime(2005,6,30).operator double()),TVariant(TDateTime(2005,7,2).operator double()),TNoParam(),TNoParam()); var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(1)); G2antt1->EndUpdate(); |
1632 |
I am using AllowGroupBy property and calling the Column.SortOrder property groups by that column. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's GroupBy bar
|
1631 |
Calling programatically the Column.SortOrder property adds the column to the sort bar. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's Sort bar
|
1630 |
How can I specify different working parts for different items
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Tasks"); Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Working"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(258)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarKey,TVariant("A")); var_Column->FormatColumn = L"(0:=round(value*24)) != 0 ? =:0 : ''"; Exg2anttlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"NonWorking"); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarProperty,TVariant(259)); var_Column1->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueToItemBarKey,TVariant("A")); var_Column1->FormatColumn = L"(0:=round(value*24)) != 0 ? =:0 : ''"; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,78); var_Chart->AllowCreateBar = Exg2anttlib_tlb::CreateBarEnum::exCreateBarAuto; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,20).operator double())); var_Chart->DrawLevelSeparator = Exg2anttlib_tlb::LevelLineEnum::exLevelNoLine; var_Chart->LevelCount = 3; var_Chart->get_Level(1)->DrawGridLines = false; var_Chart->AllowInsideZoom = true; var_Chart->DrawDateTicker = true; var_Chart->DateTickerLabel = L"<%mmm%> <%d%><br><b><%hh%>:<%nn%></b>"; var_Chart->MarkSelectDateColor = 0x7ffff8ee; Exg2anttlib_tlb::IInsideZoomFormatPtr var_InsideZoomFormat = var_Chart->DefaultInsideZoomFormat; var_InsideZoomFormat->OwnerLabel = L"<%mmm%> <%d%>"; var_InsideZoomFormat->BackColor = RGB(238,248,255); var_InsideZoomFormat->BackColorChart = var_InsideZoomFormat->BackColor; var_InsideZoomFormat->InsideCount = 4; var_InsideZoomFormat->InsideLabel = L"<b><%hh%></b>"; var_Chart->InsideZooms->Add(TVariant(TDateTime(2005,6,22).operator double())); var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exVLines; var_Chart->Bars->get_Item(TVariant("Split"))->Color = RGB(255,0,0); Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->Add(L"Task:Split"); var_Bar->Color = RGB(255,0,0); var_Bar->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternBDiagonal; var_Bar->Shortcut = L"Task"; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AllowCellValueToItemBar = true; long h1 = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h1,TVariant("Task"),TVariant(TDateTime(2005,6,22,8,00,00,0).operator double()),TVariant(TDateTime(2005,6,28).operator double()),TVariant("A"),TNoParam()); var_Items->set_ItemBar(h1,TVariant("A"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); var_Items->set_ItemNonworkingUnits(h1,TVariant(false),L"weekday(value) in (1,2)"); var_Items->set_ItemNonworkingUnits(h1,TVariant(true),L"weekday(value) in (1,2) or (hour(value)<8 or hour(value)>=16 )"); long h2 = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h2,TVariant("Task"),TVariant(TDateTime(2005,6,22,4,00,00,0).operator double()),TVariant(TDateTime(2005,6,29,12,00,00,0).operator double()),TVariant("A"),TNoParam()); var_Items->set_ItemBar(h2,TVariant("A"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); var_Items->set_ItemNonworkingUnits(h2,TVariant(false),L"weekday(value) in (1,2)"); var_Items->set_ItemNonworkingUnits(h2,TVariant(true),L"weekday(value) in (1, 2) or (hour(value)<4 or hour(value)>=12 )"); G2antt1->EndUpdate(); |
1629 |
How can I define the default bar's foreground color
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->set_PaneWidth(false,48); Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->Height = 15; var_Bar->Pattern = Exg2anttlib_tlb::PatternEnum::exPatternSolid; var_Bar->set_Def(Exg2anttlib_tlb::ItemBarPropertyEnum::exBarForeColor,TVariant(16777215)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Task 1")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K1"),TVariant("bar A")); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K2"),TVariant("bar B")); var_Items->AddBar(var_Items->AddItem(TVariant("Task 3")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,6).operator double()),TVariant("K3"),TVariant("bar C")); G2antt1->EndUpdate(); |
1628 |
How can I print the selected items only
// AddItem event - Occurs after a new Item has been inserted to Items collection. void __fastcall TForm1::G2antt1AddItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(Item,TVariant("Task"),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(2))),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(4))),TNoParam(),TNoParam()); } G2antt1->BeginUpdate(); G2antt1->SingleSel = false; G2antt1->ColumnAutoResize = false; G2antt1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); G2antt1->DataSource = (IDispatch*)rs; G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(1994,8,4).operator double())); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_SelectItem(var_Items->get_ItemByIndex(0),true); var_Items->set_SelectItem(var_Items->get_ItemByIndex(2),true); var_Items->set_SelectItem(var_Items->get_ItemByIndex(4),true); G2antt1->EndUpdate(); /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: ExPrint 1.0 Control Library TypeLib: ExPrint.dll to define the namespace: Exprintlib_tlb */ //#include "EXPRINTLIB_TLB.h" Exprintlib_tlb::IExPrintPtr var_Print = Variant::CreateObject(L"Exontrol.Print"); var_Print->set_Options(TVariant("Print = Selection")); var_Print->PrintExt = (IUnknown*)G2antt1->DefaultDispatch; var_Print->Preview(); |
1627 |
How can I sort the columns to be displayed on the columns floating bar
|
1626 |
How can I add a vertical padding for my cells
G2antt1->BeginUpdate(); G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Padding"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellSingleLine,TVariant(false)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellPaddingLeft,TVariant(6)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellPaddingRight,TVariant(6)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellPaddingTop,TVariant(6)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellPaddingBottom,TVariant(6)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant("padding")); var_Items->AddItem(TVariant("padding")); G2antt1->EndUpdate(); |
1625 |
Trying to fill the second columns. How can I do that
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Column 1"); var_Columns->Add(L"Column 2"); var_Columns->Add(L"Column 3"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("SubItem 1.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("SubItem 1.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("SubItem 1.3")); h = var_Items->AddItem(TVariant("SubItem 2.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("SubItem 2.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("SubItem 2.3")); G2antt1->EndUpdate(); |
1624 |
How can I specify a different background color for item, in chart or list panels
G2antt1->Columns->Add(L"Default"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Root")); long hC = var_Items->InsertItem(h,TNoParam(),TVariant("Child 1")); var_Items->set_ItemBackColor(hC,RGB(255,0,0)); G2antt1->Chart->set_ItemBackColor(hC,RGB(0,255,0)); var_Items->InsertItem(h,TNoParam(),TVariant("Child 2")); var_Items->set_ExpandItem(h,true); |
1623 |
Is it possible to specify a status part for each bar
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); G2antt1->Chart->set_PaneWidth(false,64); G2antt1->Debug = true; G2antt1->VisualAppearance->Add(1,TVariant(String("gBFLBCJwBAEHhEJAAChABL8IQAAYAQGKIaBwAKBQAGaAoDDQNgyQwAAxwdBMKgBBCLIxhEYobgmGIaRjHcQjEKoSxHEqIRpGCRoJiqLIZAJIEZRZAcaQvGSQYRASCRN") + "DEOA0TDAY4jPD4aQiGIbRjjeL5YjiNo2UxTNRQCEB")); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("A"),TNoParam()); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,5).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TVariant("B1"),TNoParam()); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,8).operator double()),TVariant(TDateTime(2001,1,17).operator double()),TVariant("B2"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K3"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 4")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K4"),TNoParam()); var_Items->set_ItemBar(0,TVariant("<*>"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(255)); var_Items->set_ItemBar(0,TVariant("<*>"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarFrameColor,TVariant(16777216)); G2antt1->EndUpdate(); |
1622 |
How can I change the the focus rectangle
G2antt1->BeginUpdate(); G2antt1->VisualAppearance->Add(1,TVariant("C:\\Program Files\\Exontrol\\ExG2antt\\sample\\EBN\\hoverinsert.ebn")); G2antt1->Background[Exg2anttlib_tlb::BackgroundPartEnum::exShowFocusRect] = 0x1000000; Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Check"); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellPaddingLeft,TVariant(2)); var_Column->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); G2antt1->SelForeColor = G2antt1->ForeColor; G2antt1->SelBackColor = G2antt1->BackColor; G2antt1->DefaultItemHeight = 22; G2antt1->ShowFocusRect = true; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant("")); var_Items->AddItem(TVariant("")); G2antt1->EndUpdate(); |
1621 |
Can each cell have their own dropdown lists that contain "different list item values" for each cell, not predefined for the entire column
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IEditorPtr var_Editor = G2antt1->Columns->Add(L"Column/Cell-Same")->Editor; var_Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::DropDownListType; var_Editor->AddItem(0,L"Zero",TNoParam()); var_Editor->AddItem(1,L"One",TNoParam()); var_Editor->AddItem(2,L"Two",TNoParam()); Exg2anttlib_tlb::IEditorPtr var_Editor1 = G2antt1->Columns->Add(L"Column/Cell-Different")->Editor; var_Editor1->EditType = Exg2anttlib_tlb::EditTypeEnum::EditType; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TNoParam()); long h = var_Items->AddItem(TVariant(0)); Exg2anttlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor2->EditType = Exg2anttlib_tlb::EditTypeEnum::DropDownListType; var_Editor2->AddItem(3,L"Three",TNoParam()); var_Editor2->AddItem(4,L"Four",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(3)); var_Items->AddItem(TNoParam()); h = var_Items->AddItem(TVariant(0)); Exg2anttlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor3->EditType = Exg2anttlib_tlb::EditTypeEnum::CheckListType; var_Editor3->AddItem(1,L"Single",TNoParam()); var_Editor3->AddItem(2,L"Double",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(3)); G2antt1->EndUpdate(); |
1620 |
How can I specify just a few fonts in a FontType editor
G2antt1->BeginUpdate(); G2antt1->DefaultItemHeight = 22; G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exRowLines; Exg2anttlib_tlb::IEditorPtr var_Editor = G2antt1->Columns->Add(L"Fonts")->Editor; var_Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::FontType; var_Editor->ClearItems(); var_Editor->AddItem(0,L"Calibri",TNoParam()); var_Editor->AddItem(1,L"Arial",TNoParam()); var_Editor->AddItem(2,L"Rockwell",TNoParam()); var_Editor->AddItem(3,L"Tahoma",TNoParam()); var_Editor->SortItems(TVariant(true),TNoParam()); var_Editor->DropDownRows = 4; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant("Tahoma")); G2antt1->EndUpdate(); |
1619 |
How can I show only the working-hours in chart and histogram panels
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Tasks"); G2antt1->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,40); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2005,6,20).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 64; var_Chart->HistogramView = Exg2anttlib_tlb::HistogramViewEnum::exHistogramAllItems; var_Chart->LevelCount = 3; var_Chart->NonworkingHours = 16253183; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistOverAllocation; var_Bar->HistogramPattern = var_Bar->Pattern; var_Chart->ShowNonworkingDates = false; var_Chart->ShowNonworkingUnits = false; var_Chart->ShowNonworkingHours = false; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; var_Chart->UnitScale = Exg2anttlib_tlb::UnitEnum::exHour; var_Chart->UnitWidth = 4; var_Chart->ResizeUnitScale = var_Chart->UnitScale; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task A")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,23,11,00,00,0).operator double()),TVariant(TDateTime(2005,6,23,12,00,00,0).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("0.0416666")); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); h = var_Items->AddItem(TVariant("Task B")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2005,6,23,12,00,00,0).operator double()),TVariant(TDateTime(2005,6,23,16,00,00,0).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarEffort,TVariant("0.0416666")); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarKeepWorkingCount,TVariant(true)); G2antt1->EndUpdate(); |
1618 |
How do you embed HTML options into the anchor click string
// AnchorClick event - Occurs when an anchor element is clicked. void __fastcall TForm1::G2antt1AnchorClick(TObject *Sender,BSTR AnchorID,BSTR Options) { OutputDebugString( L"AnchorID" ); OutputDebugString( L"Options" ); } G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; var_Columns->Add(L"Car")->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant("<a mazda_1;options for 1>Mazda <b>1</b></a>")); var_Items->AddItem(TVariant("<a mazda_2;options for 2>Mazda <b>2</b></a>")); var_Items->AddItem(TVariant("<a mazda_3;options for 3a>Mazda <b>3.a</b></a>")); var_Items->AddItem(TVariant("<a mazda_3;options for 3b>Mazda <b>3.b</b></a>")); G2antt1->EndUpdate(); |
1617 |
How do I add a checkbox column (method 2)
// CellStateChanged event - Fired after cell's state has been changed. void __fastcall TForm1::G2antt1CellStateChanged(TObject *Sender,Exg2anttlib_tlb::HITEM Item,long ColIndex) { OutputDebugString( L"CheckBox Changed:" ); OutputDebugString( PChar(G2antt1->Items->get_CellState(TVariant(Item),TVariant(ColIndex))) ); } G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Check")->set_Def(Exg2anttlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 1"))),TVariant(0),0); var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 2"))),TVariant(0),1); var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 3"))),TVariant(0),0); var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 4"))),TVariant(0),1); G2antt1->EndUpdate(); |
1616 |
How do I add a checkbox column (method 1)
// Change event - Occurs when the user changes the cell's content. void __fastcall TForm1::G2antt1Change(TObject *Sender,Exg2anttlib_tlb::HITEM Item,long ColIndex,Variant * NewValue) { OutputDebugString( L"CheckBox Changed:" ); OutputDebugString( L"NewValue" ); } G2antt1->BeginUpdate(); Exg2anttlib_tlb::IColumnPtr var_Column = G2antt1->Columns->Add(L"Check"); Exg2anttlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::CheckValueType; var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exCheckValue2,TVariant(1)); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddItem(TVariant(0)); var_Items->AddItem(TVariant(1)); var_Items->AddItem(TVariant(0)); var_Items->AddItem(TVariant(1)); G2antt1->EndUpdate(); |
1615 |
How do I change the progress bar's appearance
Exg2anttlib_tlb::IAppearancePtr var_Appearance = G2antt1->VisualAppearance; var_Appearance->Add(1,TVariant("c:\\exontrol\\images\\normal.ebn")); var_Appearance->Add(2,TVariant("c:\\exontrol\\images\\pushed.ebn")); Exg2anttlib_tlb::IEditorPtr var_Editor = G2antt1->Columns->Add(L"Progress")->Editor; var_Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::ProgressBarType; var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exProgressBarBackColor,TVariant(16777216)); var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exProgressBarMarkTicker,TVariant(33554432)); G2antt1->Items->AddItem(TVariant(33)); |
1614 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 3)
G2antt1->BeginUpdate(); G2antt1->VisualAppearance->Add(1,TVariant(String("gBFLBCJwBAEHhEJAEGg4BVEIQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQCWIAzATGYBRfIUEgjBM6ExwG78e") + "gBHp/ZpkACIJJAaRjHQdJxGKKMQB9DIhCZpeKhWgkKIJBzOEyBRC4ERBGqNGrsIgLEqWZpnWhaNpWXYTLyBN64LhuK46g53O6wLxvK6hEr2dJ/YBcIAOfghf4NQ7EMRx" + "LC8Mw3BDvYDkOAABAIgI=")); G2antt1->SelBackColor = 0x1fffffe; G2antt1->SelForeColor = RGB(0,0,0); G2antt1->SelBackColor = 0x1000000; G2antt1->ShowFocusRect = false; G2antt1->Columns->Add(L"Items"); G2antt1->DefaultItemHeight = 22; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("red")),RGB(255,0,0)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("blue")),RGB(0,0,255)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("green")),RGB(0,255,0)); G2antt1->EndUpdate(); |
1613 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 2)
G2antt1->BeginUpdate(); G2antt1->SelBackMode = Exg2anttlib_tlb::BackModeEnum::exTransparent; G2antt1->DefaultItemHeight = 22; G2antt1->ShowFocusRect = false; G2antt1->Columns->Add(L"Items"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("red")),RGB(255,0,0)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("blue")),RGB(0,0,255)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("green")),RGB(0,255,0)); G2antt1->EndUpdate(); |
1612 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 1)
G2antt1->BeginUpdate(); G2antt1->SelBackColor = G2antt1->BackColor; G2antt1->SelForeColor = G2antt1->ForeColor; G2antt1->DefaultItemHeight = 22; G2antt1->ShowFocusRect = true; G2antt1->Columns->Add(L"Items"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("red")),RGB(255,0,0)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("blue")),RGB(0,0,255)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("green")),RGB(0,255,0)); G2antt1->EndUpdate(); |
1611 |
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). void __fastcall TForm1::G2antt1BeforeExpandItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item,Variant * Cancel) { OutputDebugString( L"BeforeExpandItem" ); OutputDebugString( L"Item" ); G2antt1->Items->InsertItem(Item,TNoParam(),TVariant("new child")); } G2antt1->BeginUpdate(); G2antt1->LinesAtRoot = Exg2anttlib_tlb::LinesAtRootEnum::exLinesAtRoot; Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; Exg2anttlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Items"); var_Column->DisplayFilterButton = true; var_Column->FilterList = Exg2anttlib_tlb::FilterListEnum::exRootItems; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->set_ItemHasChildren(var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Group 1")),true); var_Items->set_ItemHasChildren(var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Group 2")),true); G2antt1->EndUpdate(); |
1610 |
How can identify when I clicked Hour, Month, or Year of the time-scale overview
|
1609 |
How can define a minimum and maximum in a column SpinType
Exg2anttlib_tlb::IColumnsPtr var_Columns = G2antt1->Columns; Exg2anttlib_tlb::IEditorPtr var_Editor = var_Columns->Add(L"SpinType between 5 and 150")->Editor; var_Editor->EditType = Exg2anttlib_tlb::EditTypeEnum::SliderType; var_Editor->Numeric = Exg2anttlib_tlb::NumericEnum::exInteger; var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exSliderWidth,TVariant(0)); var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exSliderMin,TVariant(5)); var_Editor->set_Option(Exg2anttlib_tlb::EditorOptionEnum::exSliderMax,TVariant(150)); G2antt1->Items->AddItem(TVariant(50)); |
1608 |
How I can change the title of the time-scale overview. (Example: Month by 'Mes', Day by 'Dia')
|
1607 |
Is it possible to set a fixed wide for the Items List Arrea, so that when changing the Form.width, the Items List Arrea be constant and therefor changing the Chart Area-wide
|
1606 |
How can I clear the colors for all bars at once
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); G2antt1->Chart->set_PaneWidth(false,64); G2antt1->Debug = true; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("A"),TNoParam()); var_Items->set_ItemBar(h,TVariant("A"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(65280)); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,5).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TVariant("B1"),TNoParam()); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,8).operator double()),TVariant(TDateTime(2001,1,17).operator double()),TVariant("B2"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K3"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 4")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K4"),TNoParam()); var_Items->set_ItemBar(0,TVariant("<*>"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(0)); G2antt1->EndUpdate(); |
1605 |
How can I change the colors for all bars at once
G2antt1->BeginUpdate(); G2antt1->Columns->Add(L"Task"); G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); G2antt1->Chart->set_PaneWidth(false,64); G2antt1->Debug = true; Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; long h = var_Items->AddItem(TVariant("Task 1")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("A"),TNoParam()); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,5).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TVariant("B1"),TNoParam()); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,8).operator double()),TVariant(TDateTime(2001,1,17).operator double()),TVariant("B2"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 2")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K3"),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Task 4")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TVariant("K4"),TNoParam()); var_Items->set_ItemBar(0,TVariant("<*>"),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(255)); G2antt1->EndUpdate(); |
1604 |
How can I show my custom bars in the histogram (method 3)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->LevelCount = 2; var_Chart->AllowLinkBars = false; var_Chart->DrawGridLines = Exg2anttlib_tlb::GridLinesEnum::exAllLines; var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2000,12,31).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 64; var_Chart->set_PaneWidth(false,128); Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->get_Item(TVariant("Task")); var_Bar->HistogramType = Exg2anttlib_tlb::HistogramTypeEnum::exHistCumulative; var_Bar->HistogramItems = 6; var_Bar->HistogramPattern = var_Bar->Pattern; var_Bar->HistogramCumulativeOriginalColorBars = Exg2anttlib_tlb::HistogramCumulativeOriginalColorBarsEnum::exKeepOriginalColor; var_Bar->OverlaidType = Exg2anttlib_tlb::OverlaidBarsTypeEnum::exOverlaidBarsOffset; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Item 1")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Item 2")),TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); long h = var_Items->AddItem(TVariant("Item 3")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,8).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(255)); G2antt1->EndUpdate(); |
1603 |
How can I show my custom bars in the histogram (method 2)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,64); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 32; var_Chart->Bars->get_Item(TVariant("Task"))->HistogramPattern = Exg2anttlib_tlb::PatternEnum::exPatternBDiagonal; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Item 1")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Item 2")),TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); long h = var_Items->AddItem(TVariant("Item 3")); var_Items->AddBar(h,TVariant("Task"),TVariant(TDateTime(2001,1,8).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TNoParam(),TNoParam()); var_Items->set_ItemBar(h,TVariant(""),Exg2anttlib_tlb::ItemBarPropertyEnum::exBarColor,TVariant(255)); G2antt1->EndUpdate(); |
1602 |
How can I show my custom bars in the histogram (method 1)
G2antt1->BeginUpdate(); Exg2anttlib_tlb::IChartPtr var_Chart = G2antt1->Chart; var_Chart->set_PaneWidth(false,64); var_Chart->set_FirstVisibleDate(TVariant(TDateTime(2001,1,1).operator double())); var_Chart->HistogramVisible = true; var_Chart->HistogramHeight = 32; var_Chart->Bars->get_Item(TVariant("Task"))->HistogramPattern = Exg2anttlib_tlb::PatternEnum::exPatternBDiagonal; Exg2anttlib_tlb::IBarPtr var_Bar = var_Chart->Bars->Copy(L"Task",L"MyBar"); var_Bar->HistogramPattern = Exg2anttlib_tlb::PatternEnum::exPatternFDiagonal; var_Bar->Color = RGB(255,0,0); var_Bar->HistogramColor = var_Bar->Color; G2antt1->Columns->Add(L"Column"); Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(var_Items->AddItem(TVariant("Item 1")),TVariant("Task"),TVariant(TDateTime(2001,1,2).operator double()),TVariant(TDateTime(2001,1,4).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Item 2")),TVariant("Task"),TVariant(TDateTime(2001,1,3).operator double()),TVariant(TDateTime(2001,1,7).operator double()),TNoParam(),TNoParam()); var_Items->AddBar(var_Items->AddItem(TVariant("Item 3")),TVariant("MyBar"),TVariant(TDateTime(2001,1,8).operator double()),TVariant(TDateTime(2001,1,12).operator double()),TNoParam(),TNoParam()); G2antt1->EndUpdate(); |
1601 |
Do you have any Fit-To-Page options when printing the control
// AddItem event - Occurs after a new Item has been inserted to Items collection. void __fastcall TForm1::G2antt1AddItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item) { Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items; var_Items->AddBar(Item,TVariant("Task"),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(2))),TVariant(var_Items->get_CellValue(TVariant(Item),TVariant(4))),TNoParam(),TNoParam()); } G2antt1->BeginUpdate(); G2antt1->ColumnAutoResize = false; G2antt1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); G2antt1->DataSource = (IDispatch*)rs; G2antt1->Chart->set_FirstVisibleDate(TVariant(TDateTime(1994,8,4).operator double())); G2antt1->EndUpdate(); /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: ExPrint 1.0 Control Library TypeLib: ExPrint.dll to define the namespace: Exprintlib_tlb */ //#include "EXPRINTLIB_TLB.h" Exprintlib_tlb::IExPrintPtr var_Print = Variant::CreateObject(L"Exontrol.Print"); var_Print->set_Options(TVariant("FitToPage = On")); var_Print->PrintExt = (IUnknown*)G2antt1->DefaultDispatch; var_Print->Preview(); |